-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix jest usage and add retry #2838
Conversation
Codecov Report
@@ Coverage Diff @@
## v4 #2838 +/- ##
=======================================
Coverage 93.04% 93.04%
=======================================
Files 39 39
Lines 1308 1308
Branches 348 348
=======================================
Hits 1217 1217
Misses 87 87
Partials 4 4 Continue to review full report at Codecov.
|
@@ -400,7 +400,7 @@ describe('Client console.log', () => { | |||
})`; | |||
options = { ...mode, ...options }; | |||
const testOptions = Object.assign({}, baseOptions, options); | |||
await it(title, async (done) => { | |||
await it(title, (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test functions cannot both take a 'done' callback and return something. Either use a 'done' callback, or return a promise.
}); | ||
server.close(done); | ||
} else { | ||
done(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
was not called if the server
was null
, causing Exceeded timeout of 20000 ms for a hook.
.
@@ -42,9 +42,7 @@ describe('https option', () => { | |||
req.get('/').expect(200, /Heyo/, done); | |||
}); | |||
|
|||
afterAll(() => { | |||
testServer.close(); | |||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testServer.close
requires a callback, causing TypeError: done is not a function
.
@@ -9,34 +9,29 @@ jest.mock('os', () => { | |||
}); | |||
|
|||
describe('runBonjour', () => { | |||
let mock; | |||
let publish = jest.fn(); | |||
let unpublishAll = jest.fn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variables referenced outside of jest.mock()
now requires to be prefixed with mock
.
Big thanks for helping |
For Bugs and Features; did you add new tests?
N/A
Motivation / Use-Case
jest
to 26.6.3jest-circus
runnerpuppeteer
Breaking Changes
N/A
Additional Info